alert('SceneToolBar.js loaded');

function SceneToolBar() {

};

SceneToolBar.prototype.initialize = function () {
	alert("SceneToolBar.initialize()");
	// this function will be called only once when the scene manager show this scene first time
	// initialize the scene controls and styles, and initialize your variables here
	// scene HTML and CSS will be loaded before this function is called

	$('#toolbar').sfImage({
		src:'images/hud/ToolBar.png'
	});
	
	$('#redButton').sfImage({
		src:'images/redButton.png'
	});
	
	$('#blueButton').sfImage({
		src:'images/blueButton.png'
	});
	
	$('#yellowButton').sfImage({
		src:'images/yellowButton.png'
	});
	
	$('#greenButton').sfImage({
		src:'images/greenButton.png'
	});
	
	$('#enterButton').sfImage({
		src:'images/enter.png'
	});
	
	$('#returnButton').sfImage({
		src:'images/return.png'
	});
	
	$('#directions').sfImage({
		src:'images/hud/Bouton-fleche-ok.png'
	});
	
	$('#labelRed').sfLabel({
		text: 'truc'
	});
	
	$('#labelBlue').sfLabel({
		text: 'machin'
	});
	
	$('#labelYellow').sfLabel({
		text: 'bidul'
	});
	
	$('#labelGreen').sfLabel({
		text: 'chouette'
	});
	
	$('#labelEnter').sfLabel({
		text: 'OK'
	});
	
	$('#labelReturn').sfLabel({
		text: 'Back'
	});
	
	$('#labelUp').sfLabel({
		text: 'Up'
	});
	
	$('#labelDown').sfLabel({
		text: 'Down'
	});
	
	$('#labelLeft').sfLabel({
		text: 'Left'
	});
	
	$('#labelRight').sfLabel({
		text: 'Right'
	});
	
	$('#redButton').css('left','10px');
	$('#blueButton').css('left','180px');
	$('#yellowButton').css('left','350px');
	$('#greenButton').css('left','520px');	
	$('#enterButton').css('left','690px');
	$('#returnButton').css('left','860px');
	$('#directions').css('left','1100px');
	
	$('#labelRed').css('left','40px');
	$('#labelBlue').css('left','210px');
	$('#labelYellow').css('left','380px');
	$('#labelGreen').css('left','550px');
	$('#labelEnter').css('left','720px');
	$('#labelReturn').css('left','890px');
	$('#labelUp').css('left','1115px');
	$('#labelDown').css('left','1100px');
	$('#labelLeft').css('left','1065px');
	$('#labelRight').css('left','1155px');
	
};

SceneToolBar.prototype.handleShow = function (data) {
	alert("SceneToolBar.handleShow()");
	// this function will be called when the scene manager show this scene
};

SceneToolBar.prototype.handleHide = function () {
	alert("SceneToolBar.handleHide()");
	// this function will be called when the scene manager hide this scene
};

SceneToolBar.prototype.handleFocus = function () {
	alert("SceneToolBar.handleFocus()");
	// this function will be called when the scene manager focus this scene
};

SceneToolBar.prototype.handleBlur = function () {
	alert("SceneToolBar.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene
};

SceneToolBar.prototype.handleKeyDown = function (keyCode) {
	alert("SceneToolBar.handleKeyDown(" + keyCode + ")");
	// TODO : write an key event handler when this scene get focued
	switch (keyCode) {
		case sf.key.LEFT:
			break;
		case sf.key.RIGHT:
			break;
		case sf.key.UP:
			break;
		case sf.key.DOWN:
			break;
		case sf.key.ENTER:
			break;
		case sf.key.RETURN:
			break;
		default:
			alert("handle default key event, key code(" + keyCode + ")");
			break;
	}
};


function changeLabelTxt(labelName,newTxt){
	labelName= '#' + labelName;
	
	$(labelName).sfLabel({
		text: newTxt
	});
}